<template>
  <div>
    <van-sidebar v-model="activeKey" style="height: 158vw">
      <van-sidebar-item
        v-for="(v, index) in items"
        :key="index"
        :title="v"
        @click="cut(v)"
      ></van-sidebar-item>
    </van-sidebar>
    <!-- <keep-alive> -->
      <Right class="abc"></Right>
    <!-- </keep-alive> -->
  </div>
</template>

<script>
import Right from './Right.vue';
import axios from 'axios';
export default {
  components: {
    Right,
  },
  data() {
    return {
      items: [],
      activeKey: 0,
    };
  },
  mounted() {
    // 商品分类列表
    this.$http({
      url: "api/pro/categorylist",
      method: "get",
    }).then((res) => {
      res.data.data.forEach((element) => {
        this.items.push(element);
      });
    });
  },

  methods: {
    cut(v) {
      this.$bus.$emit("classify", v);
    }
  },
};
</script>
<style lang="scss" scoped>
.abc {
  position: fixed;
  top: 12.2vw;
  right: 0;
  width: 79vw;
  height: 153vw;
  background-color: #fff;
  overflow: scroll;
}
.van-sidebar-item--select::before{
  background-color: #fff;
  
}
</style>


